package com.dyzx.hbb.modules.attendance.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

/**
 * 考勤打卡记录表
 * @TableName attendance_work_user
 */
@TableName(value ="attendance_clock_work_user")
@Data
public class AttendanceClockWorkUser {
    /**
     * 主键ID
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 状态: 1-草稿, 2-待处理, 3-已完成, 4-已取消
     */
    private Integer status;

    /**
     * 创建日期（毫秒级时间戳）
     */
    @TableField(fill = FieldFill.INSERT)
    private Long createDate;

    /**
     * 更新日期（毫秒级时间戳）
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long updateDate;

    /**
     * 删除标记: 0-未删除, 1-已删除
     */
    private Integer deleted;

    /**
     * 操作人ID
     */
    private Long operatorId;

    /**
     * 企业ID
     */
    private Long organId;

    /**
     * 规则ID
     */
    private Long configId;

    /**
     * 用户ID
     */
    private Long userId;

    /**
     * 班次ID（可选，关联work_shift.shift_id）
     */
    private Long shiftId;

    /**
     * 开始时间(毫秒)
     */
    private Long startTime;

    /**
     * 结束时间(毫秒)
     */
    private Long endTime;

    /**
     * 打卡位置（GPS/地址）
     */
    private String location;

    /**
     * 备注
     */
    private String description;

    /**
     * 设备ID
     */
    private Long deviceId;

    /**
     * 类型: 1-上班, 2-下班, 3-外出, 4-返回
     */
    private Integer type;

    /**
     * 打卡状态（1-正常，2-迟到，3-早退，4-旷工）
     */
    private Integer startStatus;

    /**
     * 打卡状态（1-正常，2-迟到，3-早退，4-旷工）
     */
    private Integer endStatus;

    /**
     * 毫秒
     */
    private Long startStatusTime;

    /**
     * 毫秒
     */
    private Long endStatusTime;
    private Long imageId;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        AttendanceClockWorkUser other = (AttendanceClockWorkUser) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getCreateDate() == null ? other.getCreateDate() == null : this.getCreateDate().equals(other.getCreateDate()))
            && (this.getUpdateDate() == null ? other.getUpdateDate() == null : this.getUpdateDate().equals(other.getUpdateDate()))
            && (this.getDeleted() == null ? other.getDeleted() == null : this.getDeleted().equals(other.getDeleted()))
            && (this.getOperatorId() == null ? other.getOperatorId() == null : this.getOperatorId().equals(other.getOperatorId()))
            && (this.getOrganId() == null ? other.getOrganId() == null : this.getOrganId().equals(other.getOrganId()))
            && (this.getConfigId() == null ? other.getConfigId() == null : this.getConfigId().equals(other.getConfigId()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getShiftId() == null ? other.getShiftId() == null : this.getShiftId().equals(other.getShiftId()))
            && (this.getStartTime() == null ? other.getStartTime() == null : this.getStartTime().equals(other.getStartTime()))
            && (this.getEndTime() == null ? other.getEndTime() == null : this.getEndTime().equals(other.getEndTime()))
            && (this.getLocation() == null ? other.getLocation() == null : this.getLocation().equals(other.getLocation()))
            && (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription()))
            && (this.getDeviceId() == null ? other.getDeviceId() == null : this.getDeviceId().equals(other.getDeviceId()))
            && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
            && (this.getStartStatus() == null ? other.getStartStatus() == null : this.getStartStatus().equals(other.getStartStatus()))
            && (this.getEndStatus() == null ? other.getEndStatus() == null : this.getEndStatus().equals(other.getEndStatus()))
            && (this.getStartStatusTime() == null ? other.getStartStatusTime() == null : this.getStartStatusTime().equals(other.getStartStatusTime()))
                && (this.getImageId() == null ? other.getImageId() == null : this.getImageId().equals(other.getImageId()))
            && (this.getEndStatusTime() == null ? other.getEndStatusTime() == null : this.getEndStatusTime().equals(other.getEndStatusTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getCreateDate() == null) ? 0 : getCreateDate().hashCode());
        result = prime * result + ((getUpdateDate() == null) ? 0 : getUpdateDate().hashCode());
        result = prime * result + ((getDeleted() == null) ? 0 : getDeleted().hashCode());
        result = prime * result + ((getOperatorId() == null) ? 0 : getOperatorId().hashCode());
        result = prime * result + ((getOrganId() == null) ? 0 : getOrganId().hashCode());
        result = prime * result + ((getConfigId() == null) ? 0 : getConfigId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getShiftId() == null) ? 0 : getShiftId().hashCode());
        result = prime * result + ((getStartTime() == null) ? 0 : getStartTime().hashCode());
        result = prime * result + ((getEndTime() == null) ? 0 : getEndTime().hashCode());
        result = prime * result + ((getLocation() == null) ? 0 : getLocation().hashCode());
        result = prime * result + ((getDescription() == null) ? 0 : getDescription().hashCode());
        result = prime * result + ((getDeviceId() == null) ? 0 : getDeviceId().hashCode());
        result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
        result = prime * result + ((getStartStatus() == null) ? 0 : getStartStatus().hashCode());
        result = prime * result + ((getEndStatus() == null) ? 0 : getEndStatus().hashCode());
        result = prime * result + ((getStartStatusTime() == null) ? 0 : getStartStatusTime().hashCode());
        result = prime * result + ((getImageId() == null) ? 0 : getImageId().hashCode());
        result = prime * result + ((getEndStatusTime() == null) ? 0 : getEndStatusTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", status=").append(status);
        sb.append(", createDate=").append(createDate);
        sb.append(", updateDate=").append(updateDate);
        sb.append(", deleted=").append(deleted);
        sb.append(", operatorId=").append(operatorId);
        sb.append(", organId=").append(organId);
        sb.append(", configId=").append(configId);
        sb.append(", userId=").append(userId);
        sb.append(", shiftId=").append(shiftId);
        sb.append(", startTime=").append(startTime);
        sb.append(", endTime=").append(endTime);
        sb.append(", location=").append(location);
        sb.append(", description=").append(description);
        sb.append(", deviceId=").append(deviceId);
        sb.append(", type=").append(type);
        sb.append(", startStatus=").append(startStatus);
        sb.append(", endStatus=").append(endStatus);
        sb.append(", startStatusTime=").append(startStatusTime);
        sb.append(", imageId=").append(imageId);
        sb.append(", endStatusTime=").append(endStatusTime);
        sb.append("]");
        return sb.toString();
    }
}